﻿<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="author" content="智能社 - zhinengshe.com"/>
    <title>函数中this问题</title>
    <style>
    </style>
    <script>
        window.onload = function () {
            var oBtn = document.getElementById('btn1');
            var _this = this;

            function show(_this) {
                console.log(_this);
            }

            oBtn.onclick = function () {
                show(this);
            };
            show(_this);
        }
    </script>
</head>

<body>
<input type="button" value="点击" id="btn1">
</body>

</html>